﻿namespace EyeOpen.OopByTdd
{
	using System;
	using EyeOpen.OopByTdd.Math;

	public class MathSample : Sample
	{
		public override void Main()
		{
			var operand1 = GetOperand("1");
			var operand2 = GetOperand("2");

			var arithmeticOperation =
				new SumOperation();

			var sum =
				arithmeticOperation
					.Operation(operand1, operand2);

			Console.WriteLine("Result: {0} + {1} = {2}", operand1, operand2, sum);

			Console.ReadLine();
		}

		private int GetOperand(string operandName)
		{
			Console.WriteLine("Operand {0}", operandName);
			var operand = int.Parse(Console.ReadLine());
			return operand;
		}
	}
}